package com.bookmanger.server.service.impl;

import com.bookmanger.server.service.NotificationService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class NotificationServiceImpl implements NotificationService {

    @Override
    public void sendFineNotification(Integer readerId, String bookTitle, String reason, double amount) {
        String message = String.format("读者ID: %d，您有一笔新的罚款通知。图书：《%s》，原因：%s，金额：%.2f 元。",
                readerId, bookTitle, reason, amount);
        log.info("发送罚款通知: {}", message);
    }

    @Override
    public void sendPrebookNotification(Integer readerId, Integer isbnId) {
        String message = String.format("读者ID: %d，您预订的图书 (ISBN ID: %d) 现在有可借副本，请及时借阅。",
                readerId, isbnId);
        log.info("发送预订通知: {}", message);
    }
}